var currentDoc = fl.getDocumentDOM();
var lib=fl.getDocumentDOM().library;

checkClassName(lib.items);
function checkClassName(arr)
{	
	var newArr = new Array();
	for (var i=0;i<arr.length;i++)
	{
		if(arr[i].itemType=="movie clip")
		{
			var name = arr[i].name.substring(arr[i].name.lastIndexOf("/")+1 ,arr[i].name.length);
			if(newArr.indexOf(name)==-1)
			{
				newArr.push(name);
			}else{
				alert("错误信息! "+name+" 名称重复");
				/*var isRemove = confirm("错误信息! "+name+" 名称重复");
				if(isRemove)
				{
					
				}*/
				return;
			}
		}
	}
	
	
	setClassName(lib.items)
}


function setClassName(arr)
{
	for (var i=0;i<arr.length;i++)
	{
		if(arr[i].itemType=="movie clip")
		{
			arr[i].linkageExportForAS=true;
			arr[i].linkageExportInFirstFrame=true;
			//fl.trace(arr[i].name);
			arr[i].linkageClassName = arr[i].name.substring(arr[i].name.lastIndexOf("/")+1 ,arr[i].name.length);
		}
	}
	alert("修改成功...");
}